#!/usr/bin/env python
# -*- coding: utf-8 -*-

from fastapi import APIRouter
from fastapi import Depends
from models.crud import *

user_router = APIRouter()
from . import create_db


@user_router.get("/users", response_model=List[UserOut])
def get_users(skip: int = 0, limit: int = 10, db:Session=Depends(create_db)):
    return get_users_method(db, skip, limit)


@user_router.post("/users", response_model=UserOut)
def create_user(user: UserModel, db: Session = Depends(create_db)):
    return create_user_method(db, user)


@user_router.get("/users/{uid}", response_model=UserOut)
def get_user(uid:int, db:Session=Depends(create_db)):
    return get_user_method(db, uid)

